package com.sgb.kjwl.view.ui.adapter.transport;

import android.content.Context;
import android.widget.TextView;

import androidx.databinding.library.baseAdapters.BR;

import com.sgb.kjwl.R;
import com.sgb.kjwl.model.entity.transport.MapGoodsBiddingEntity;
import com.swgk.core.recyclerview.adapter.BaseRecycleAdapter;
import com.swgk.core.recyclerview.adapter.ItemViewHolder;
import com.swgk.core.util.DateUtils;

import java.util.List;

public class MapGoodsBiddingAdapter extends BaseRecycleAdapter<MapGoodsBiddingEntity> {

    public MapGoodsBiddingAdapter(Context context, List<MapGoodsBiddingEntity> datas) {
        super(context, R.layout.item_map_goods_bidding_pop, datas);
    }

    @Override
    public void convert(ItemViewHolder holder, MapGoodsBiddingEntity goodsInfoEntity3) {
        holder.setBinding(BR.viewModel, goodsInfoEntity3);

        TextView textView = holder.getItem().findViewById(R.id.load_time);
        textView.setText(DateUtils.stampToDay(goodsInfoEntity3.getShipmentTime()));

        TextView tvPrice = holder.getItem().findViewById(R.id.price_view);
        tvPrice.setText(goodsInfoEntity3.getFreight() + "元/吨");
    }
}
